package com.foreknow.demo5;

import java.util.Scanner;

public class BankSystem {
    //主方法
    public static void main(String[] args) {
        //初始化用户信息
        String usrName = "admin";
        String usrPwd = "123";
        double baseAccount = 10000.0;
        //拉取界面
        getMenu();
        //拉取登录
        boolean isLogin = getLogin(usrName,usrPwd);
        while (isLogin){
            while (true){

            }
        }
    }
    //获取界面
    public static void getMenu(){
        System.out.println("*************欢迎登录*************");
        System.out.println("***********银行************");
        System.out.println("**************版本1.0**************");
    }
    //获取登录
    public static boolean getLogin(String usr,String pwd){
        Scanner scan = new Scanner(System.in);
        for (int i = 3; i > 0;i--){
            System.out.println("请输入用户名");
            String usrInput = scan.next();
            System.out.println("请输入密码");
            String pwdInput = scan.next();
            if (usr.equals(usrInput) && pwd.equals(pwd)){
                System.out.println("登录成功");
                return true;
            }else {
                System.out.println("用户名或者密码错误，请重新输入今日还剩" + (i-1) + "次机会");
            }
        }
        return false;
    }
    //获取菜单
    public static void getBankMenu(){
        System.out.print("1.查询余额\n2.存款\n3.取款\n4.修改密码\n5.退出\n");
        System.out.println("请选择菜单");
    }
}
